﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using Microsoft.Win32;
using AgentObjects;
using SimpleUtils;
using SimpleUtils.Win;

namespace SimpleReminder
{
    public partial class frmReminderEmail : frmBase
    {
        public frmReminderEmail()
        {
            InitializeComponent();

            DialogResult = DialogResult.Cancel;

        }

        private void btnTest_Click(object sender, EventArgs e)
        {
            if (Utils.SendEmail(txtTo.Text, txtCc.Text, txtBcc.Text, EmailSubject, EmailBody))
            {
                SimpleMessage.ShowInfo("Testing email sent.");
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        public string EmailTo
        {
            get { return txtTo.Text; }
            set { txtTo.Text = value; }
        }

        public string EmailCc
        {
            get { return txtCc.Text; }
            set { txtCc.Text = value; }
        }

        public string EmailBcc
        {
            get { return txtBcc.Text; }
            set { txtBcc.Text = value; }
        }

        private string _emailSubject = String.Empty;
        public string EmailSubject
        {
            get { return _emailSubject; }
            set { _emailSubject = value; }
        }

        private string _emailBody = String.Empty;
        public string EmailBody
        {
            get { return _emailBody; }
            set { _emailBody = value; }
        }

    }//end of class
}
